# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=libhandy
pkgver=0.0.13
pkgrel=3
pkgdesc="Library full of GTK+ widgets for mobile phones"
url="https://source.puri.sm/Librem5/libhandy"
arch="all !s390x !mips !mips64" # Limited by 'ibus'
license="LGPL-2.0-or-later"
makedepends="meson glib-dev gtk+3.0-dev vala py3-setuptools gobject-introspection-dev
	glade-dev"
checkdepends="xvfb-run ibus"
subpackages="$pkgname-dev"
source="https://source.puri.sm/Librem5/libhandy/-/archive/v$pkgver/libhandy-v$pkgver.tar.gz
	skip-test.patch
	https://source.puri.sm/Librem5/libhandy/-/merge_requests/451/diffs.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		-Dexamples=true \
		. output
	ninja -C output
}

check() {
	xvfb-run ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

dev() {
	default_dev

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}

sha512sums="b9eaef775a93c200aa3f526b627827ed4530ff2a4c826ab24abdbd944075c0939232bd2c3388b8b8e34c6729cb11017a7af2bd3ff9eec78fbdc7e7dd9f11d24b  libhandy-v0.0.13.tar.gz
e67a51b2985d27f1ed259773060e7df1430f7529f6cef69b1a240f97bfdccb73bd97303b96e209daa2ff7d31094f290986a663d4c7919b4799ec333b8e06a83f  skip-test.patch
ad94ccff11d3d6f87d26bb71a8bc6c1097d4a16474686614b51db9f0cd0c8b4b8d2cec5ec0b1c971da88eecc17c35ff0f183930726377f3beb9a3e02bf6fb82c  diffs.patch"
